package com.ity.teamanagement.service;

import com.ity.teamanagement.entity.Role;
import com.ity.teamanagement.entity.inputParam.AddUserParam;
import com.ity.teamanagement.entity.inputParam.UpdateUserParam;
import com.ity.teamanagement.entity.inputParam.UserLogin;
import com.ity.teamanagement.entity.outputResult.UserDetail;
import com.ity.teamanagement.utils.PageableDetails;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author coderFu
 * @create 2021/5/23
 */
public interface UserService {

    /**
     * 根据用户的账号和密码查询用户信息
     * @param userLogin
     * @param response
     * @return UserDetail
     */
    Object queryUserByUserNameAndPwd(UserLogin userLogin, HttpServletResponse response);


    /**
     * 清除redis中的登录信息完成退出登录
     */
    void logout();

    /**
     * 分页查询所有用户
     * @param pageable
     * @return
     */
    PageableDetails findAllUsers(Pageable pageable);

    /**
     *后台管理员添加用户
     * @param addUserParam
     */
    void backAddUser(AddUserParam addUserParam);

    /**
     *查询所有用户角色
     * @return
     */
    List<Role> findAllRole();

    /**
     * 后台修改用户信息
     * @param updateUserParam
     */
    void backUpdateUser(UpdateUserParam updateUserParam);

    /**
     * 后台通过id删除用户
     * @param ids
     */
    void backDeleteUserById(List<Long> ids);

    /**
     *后台根据id查询用户信息
     * @param id
     * @return
     */
    UserDetail backFindUserById(Long id);

}
